Real time optimization of power in electrical submersible pump variable speed applications

ABSTRACT

A method and apparatus for real-time monitoring of a variable frequency drive (VFD) controlling an electric submersible pump (ESP) and for fine-tuning operation of a VFD-ESP system such that oil production, power, and motor run life are optimized.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims benefit of U.S. Provisional Patent Application Ser. No. 60/888,235 filed Feb. 5, 2007, which is herein incorporated by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

Embodiments of the present invention generally relate to hydrocarbon recovery and, more particularly, to monitoring and optimizing the operation of a variable frequency drive (VFD) in real time to control an electric submersible pump (ESP), such as those used in production operations.

2. Description of the Related Art

An electric submersible pump (ESP) is a type of pump with an electric motor enclosed in a protective housing such that the assembly may be submerged in the fluid to be pumped. A system of mechanical seals may be employed to prevent the fluid being pumped from entering the motor and causing a short circuit. When used in an oil well, an operating ESP decreases the pressure at the bottom of the well and allows significantly more oil to be produced from the well when compared to natural production.

To control the production rate, the electric motor of the ESP may be driven by a variable frequency drive (VFD). Generally, the higher the drive frequency output by the VFD, the faster the electric motor rotates. A typical VFD is an electronic power conversion device that converts input AC power to DC intermediate power using a rectifier circuit and converts the DC intermediate power to quasi-sinusoidal AC power of a desired frequency using an inverter switching circuit. The voltage and current waveforms output by the VFD are no longer perfect sinusoids, but have a distorted appearance. The details of the circuits within a VFD are beyond the scope of the invention and are known to those skilled in the art, so they will not be described herein.

When the motor of an ESP is driven by a VFD, voltage and current harmonics are generated on the input and output of the VFD indicative of the distorted output waveforms. This is because a VFD is a type of nonlinear load and draws current in a non-sinusoidal manner. A power system that carries such a nonlinear load may experience such operational problems as capacitor failures, overheating of transformers and/or cables, tripping of circuit breakers, power waveform distortion, motor failures, programmable logic controller (PLC) failures or malfunction, and power generator failures. The more distorted the current waveform is, the hotter the motor will be and the more the motor run life will deteriorate. Voltage spikes on the voltage waveform from distortion may damage the insulation of the motor, which will drastically decrease the motor run life and possibly lead to a premature motor failure.

Because a VFD-ESP system possesses inductance, capacitance, and resistance due to the long cables (e.g., 10,000 ft) running between the ESP located downhole and the VFD typically located at the surface, a natural resonance condition occurs. If the VFD is operated at or near the resonant carrier frequency, voltage peaks may occur in the output waveforms. These voltage spikes from resonance may also reduce motor run life and lead to premature motor failure.

Furthermore, power companies impose fines on operators, such as hydrocarbon recovery companies, for exceeding the allowable total harmonic distortion (THD) limit on the input line of the VFD, thereby creating additional operating expenditures. In remote locations, such as the desert, where there may not be an infrastructure to supply power lines, excessive harmonics may cause the power generators to fail and need to be replaced. Equipment failures and fines combine to diminish the benefits from production optimization campaigns carried out for ESP-pumped wells.

Traditionally, a number of techniques have been applied to cope with input and output harmonics produced by VFD-ESP systems. For example, input harmonics have been reduced by placing a line filter on the input of a VFD. However, ESP motors are capable of up to 1000 horsepower (hp) @ 60 Hz, and the cost of this type of filter increases exponentially with the horsepower, thereby making line filters prohibitively expensive for many VFD-ESP systems. Furthermore, there is no guarantee with the line filter solution that the input harmonics will be within allowable limits at all operational conditions. Output harmonics have been addressed with a load filter placed at the output of the VFD. The purpose of the load filter is to smooth the waveforms and remove, or at least reduce, the high frequency spikes. Like the line filters, load filters are also often costly, and there is no guarantee that the load filters will perform equally well at all operational conditions.

Because operators are fined when exceeding the THD limits imposed by the power companies on the input line of the VFD, operators may hire a consultant group to perform a harmonic study of a violating well. During a harmonic study, the VFD is typically shut down and digital oscilloscopes may be coupled to the input and output of the VFD. Then, the VFD is restarted, waveforms at the input and output of the VFD are stored, and the THD may be recorded. The waveforms may be analyzed at a later time to determine how the allowable harmonic levels were exceeded. After some time (e.g., hours, a day, or more), the VFD is shut down, the metering equipment is removed, and the consultant group may move on to another VFD.

The main drawbacks of this method include the following: (1) the study is costly, (2) production has to be halted during VFD shutdown, (3) during every VFD restart there is heightened likelihood of burning an ESP motor, and (4) the consultant group's study is limited to a one-time recommendation based on a particular short-term operational observation of a “VFD/ESP/oil well” system, offering only a snapshot of the system. Because a VFD/ESP/oil well system is a highly dynamic system and operating parameters may change significantly every few days, this type of study does not allow the operator to react to changed operational conditions by fine-tuning well operation to reduce harmonics and prolong the life of the motor while maintaining the highest possible production level during the entire ESP run life (typically ranging from 6 months to 15 years). Such studies also cannot capture and control every possible change in operating parameters during ESP run life, archive this data, and correlate different modes of system operation to such critical parameters as ESP run life, generator and transformer shut-downs, failure of other surface electrical and electronic equipment, and loss of oil production associated with such failures to improve efficiency of future installations of generators, transformer, VFD, and ESP for the same well or oil pad.

Accordingly, what is needed is a method of operating a variable speed ESP such that hydrocarbon production can be optimized without violating the THD limit on the input power line or damaging or prematurely wearing out the equipment.

SUMMARY OF THE INVENTION

Embodiments of the present invention provide methods and apparatus for operating a variable frequency drive (VFD) coupled to an electric submersible pump (ESP) such that hydrocarbon production can be optimized without violating the THD limit on the input power line or damaging or prematurely wearing out the equipment. Data of the VFD-ESP system may be collected and analyzed in real time such that operating parameters of the VFD-ESP system may be fine-tuned in short order in an effort to maintain hydrocarbon production equilibrium.

One embodiment of the invention provides a method of adjusting one or more operating parameters of a variable frequency drive (VFD) coupled to an electric submersible pump (ESP) in real time. The method generally includes collecting data associated with the VFD and the ESP while operating the ESP, analyzing the collected data in real time to determine if the one or more operating parameters can be adjusted to achieve a desired operating state, and, in response to determining that the operating parameters can be adjusted to achieve the desired operating state, adjusting the one or more operating parameters of the VFD.

BRIEF DESCRIPTION OF THE DRAWINGS

So that the manner in which the above recited features of the present invention can be understood in detail, a more particular description of the invention, briefly summarized above, may be had by reference to embodiments, some of which are illustrated in the appended drawings. It is to be noted, however, that the appended drawings illustrate only typical embodiments of this invention and are therefore not to be considered limiting of its scope, for the invention may admit to other equally effective embodiments.

FIG. 1 is a block diagram of a well system comprising a variable frequency drive (VFD) to power an electrical submersible pump (ESP) in accordance with an embodiment of the invention;

FIGS. 2 and 2A are block diagrams of a system for measuring and analyzing properties of the VFD in real-time while data is being transmitted via a supervisory control and data acquisition (SCADA) communication system in accordance with embodiments of the invention;

FIGS. 3A and 3B are a flow diagram illustrating the optimization of a VFD in real-time in accordance with an embodiment of the invention;

FIG. 4 illustrates the harmonics that may be present in a VFD waveform in accordance with an embodiment of the invention;

FIG. 5 illustrates the analysis of data measured from the VFD input and transmitted via a SCADA communication system in accordance with an embodiment of the invention;

FIG. 6 illustrates the analysis of data measured from the VFD output by software executed on an office PC (personal computer) and transmitted via the SCADA system in accordance with an embodiment of the invention;

FIG. 7 illustrates historical tracking of data measured from the VFD input in accordance with an embodiment of the invention; and

FIG. 8 illustrates historical tracking of data measured from the VFD output in accordance with an embodiment of the invention.

DETAILED DESCRIPTION

Embodiments of the present invention provide methods and apparatus for real-time monitoring of a variable frequency drive (VFD) controlling an electric submersible pump (ESP) and for fine-tuning operation of a VFD-ESP system such that oil production, power, and motor run life are optimized.

An Exemplary VFD-ESP System

FIG. 1 is a block diagram of a typical VFD-ESP system 100. An ESP 102 may be located at or near the bottom of a well borehole in an effort to decrease the pressure at the bottom of the well and create a form of “artificial lift” for the production fluid, such as oil. The borehole may contain well casing 104 lined with cement to keep the casing 104 in place. The production fluid may travel to the well surface 108 via production tubing 106, and the well may be capped by a wellhead 110 having numerous production control devices.

The electric motor within the ESP 102 may be coupled to a VFD 112 located at the surface via a power cable 114 run inside the well casing 104. The output of the VFD 112 may be coupled to a VFD transformer 116 with various taps to permit different voltage amplitudes output from the VFD 112. For some embodiments, the ESP 102 may be coupled to the VFD 112 or the VFD transformer 116 via a junction box 118, which is meant to vent free gas trapped in a cable line. The input of the VFD 112 may be coupled to an input power source 120, such as a distribution transformer or a generator. The voltage waveform from the input power source 120 operates at a constant frequency and constant amplitude (e.g., 120 V_(rms) 60 Hz), while the output of the VFD transformer 116 allows for a variable frequency and variable voltage amplitude. The operating frequency supplied to the ESP 102 is generally proportional to the operating speed of the electric motor and, therefore, proportional to the production rate. The voltage (and hence, the power) supplied to the ESP 102 may need to be adjusted as the load changes over time with production.

As described above, power harmonics 122 may be caused by the inverter switching circuit of the VFD 112 leading to distorted waveforms and/or by operating with a carrier frequency near resonance caused by the capacitance and inductance of the long power cable 114. On the output side of the VFD 112, these harmonics 122 may cause overheating of cables, or damage to or reduced run life of the electric motor of the ESP 102 from overheating, for example. The harmonics 122 may also be reflected by the VFD 112 onto the input side where they may cause disturbances in the input power source 120. Such disturbances may lead to failure of the generator or overheating of the distribution transformer in addition to causing failures of the equipment connected to the same power line, all of which explain why power companies impose fines for exceeding the allowable total harmonic distortion (THD) limit.

An Exemplary VFD Monitoring System

FIG. 2 is a block diagram of a system 200 for measuring and analyzing properties of the VFD in real time according to some embodiments. Both the input and the output of the VFD 112 may be coupled to a waveform capture device 202, with sufficient sampling speed and a suitable number of channels. For some embodiments, the capture device 202 may be a stand-alone unit or a plug-in card for a computer. The sampling speed should be more than double that of the greatest harmonic frequency of interest according to the Nyquist criterion, as those skilled in the art will recognize. For some embodiments, both the voltage and the current may be sampled with a scope probe and a current probe, respectively, on the input and the output of the VFD 112, suggesting at least 4 channels on the capture device 202. Furthermore, since the system 200 may be intended for long-term monitoring, the connections for the capture device 202 on the VFD 112 should not interfere with normal well operation or require a VFD shutdown.

Within the capture device 202, there may be one or more analog-to-digital converters (ADCs) 204 to sample the incoming waveforms from the VFD 112. The ADCs 204 may be coupled to a memory management unit (MMU) 206 to govern memory access, which may be part of a central processing unit (CPU) or a separate integrated circuit (IC) coupled to the CPU 208 as shown. The CPU 208 may send the sampled data to an interface 210 via an input/output unit (I/O) 212, which may also be part of the CPU 208 for some embodiments. The interface 210 may be for parallel communication (e.g., general purpose interface bus (GPIB)) or serial transmission (e.g., RS-232) to a remote terminal unit (RTU) 214, such as the CAC EXS-1000 series from eProduction Solutions. The RTU 214 may be seated on the oil pad. For some embodiments, a waveform capture device may be an integral part of the RTU 214.

Among other functions, the RTU 214 may collect the sampled VFD data from the capture device 202 and make it available to a host computing device, such as a computer or a supervisory control and data acquisition (SCADA) Human Machine Interface (HMI) 216, on the network via any suitable I/O interface 218, such as Modbus™ RTU, Modbus ASCII, OPC (object linking and embedding (OLE) for Process Control, ODBC (Open DataBase for Connectivity), or proprietary protocols. For some embodiments, the sampled VFD data may be transmitted via satellite as shown in FIG. 2 to the HMI 216 located anywhere in the world. The HMI 216 may run stand-alone or integrated executable software, such as eProduction Solutions' Life-of-the-Well Info System (LOWIS), to analyze the sampled data. For other embodiments, the sampled VFD data may be processed by the CPU 208 or the HMI 216 locally, rather than remotely.

Described in greater detail below, such analysis may include calculating the THD at the input and the output of the VFD, comparing the data to other control or sensed parameters of the well or VFD, and computing trends or scenarios based on the historical data so that operating parameters of the well may be optimized. For example, by sending signals from the HMI 216 to the RTU 214, the RTU 214 can send control signals to the VFD 112 to adjust such operating parameters as the operating frequency and the carrier frequency. For some embodiments, the software running on the HMI 216 may include setpoints for automatically sending such signals. In this manner, an operator in any part of the world should be able to access the data and trends and monitor in real time how the value of THD and the operation in respect to the resonant frequency change as the operating parameters of the VFD 112 are fine-tuned.

FIG. 2A shows additional detail of the workings of the capture device 202, additional detail of the workings of the VFD 112, according to one embodiment of the invention. Note that FIG. 2A does not show all of the components illustrated in FIG. 2. FIG. 2A illustrates the capture device 202, the VFD 112, and additional elements of the system 200 as a frame of reference.

An Exemplary Method for Operating a VFD-ESP System

FIGS. 3A and 3B are a flow diagram 300 illustrating the optimization of the operating parameters for a VFD, such as the VFD 112 of the typical VFD-ESP system 100 in FIG. 1, in real time in accordance with an embodiment of the invention. The following steps may be executed in the real-time monitoring system 200 of FIG. 2 as a suitable, although not limiting, example.

In step 302, the initial VFD operating parameters may be established. These operating parameters may include, but are not limited to, the operating frequency, the carrier frequency, the base frequency, the target operating frequency, the operating frequency ramp profile and the VFD transformer tap setting. These initial operating parameters may be entered into and stored in the Human Machine Interface (HMI) 216.

Once the initial operating parameters have been set, the well may be commissioned in step 304 by configuring the VFD transformer tap setting (typically done manually) and then powering up the VFD 112. The VFD 112 may start with an initially small operating frequency, such as 30-35 Hz, and then slowly increase the operating frequency according to a ramp profile up to the target frequency, such as 35-90 Hz. The ramp profile may specify a period of a few days to months to reach the target operating frequency depending on the well. As the operating frequency increases to increase the fluid flow rate, the THD will most likely also increase at both the input and output of the VFD 112. FIG. 4 illustrates the harmonics in a power spectrum 400 that may be present in a VFD waveform of voltage or current on the input or the output of the VFD 112.

Therefore, the voltage and current waveforms at the input and the output of the VFD 112, among other data, are sampled by the capture device 202 and transmitted to the HMI 216 via the RTU 214 in step 306. As described above for some embodiments, the capture device may also be built into the RTU 214. In an effort to make an informed decision with respect to adjusting the operating parameters of the VFD 112, other data may be collected, as well, typically by the RTU 214. This data may include the VFD's operating frequency, carrier frequency, and base frequency, the system power, the power factor, the well fluid flow rate, the temperature of the electric motor of the ESP 102, and the ESP vibration.

The data collected in step 306 may be analyzed in step 308 in real time, and such analysis may occur in software packages, such as LOWIS or MATLAB®, executed by the HMI 216. On the input side of the VFD 112, the voltage and current waveforms may be displayed and analyzed. Referring now to the graph 500 in FIG. 5, the THD 502 (in %), operating frequency 504 (in Hz), power 506 (in kW), power factor 508 (in %), and fluid flow rate 510 (in stock tank barrels of oil per day (stbd)), for example, may be calculated and displayed over a small period of elapsed time. From the graph 500, as the operating frequency 504 of the VFD 112 increases, the ESP motor rotates more quickly, thereby increasing the flow rate 510. However, the THD 502 and the power 506 drawn from the input power source 120 increases with the increased VFD operating frequency 504.

On the output side of the VFD 112, the voltage and current waveforms may also be displayed and analyzed in real time. Referring now to the graph 600 in FIG. 6, motor vibration 602 (in g), apparent VFD power 604 (in kVA), real power consumed by the system 606 (in kW), motor temperature 608 (in ° F.), total harmonic distortion of the voltage (THDv) 610 (in %), total harmonic distortion of the current (THDi) 612 (in %), flow rate 614 (in stbd), the base frequency 616 (in Hz), operating frequency 618 (in Hz), carrier frequency 620 (in Hz), motor voltage imbalance 622 (in %), and motor current imbalance 624 (in %), for example, may be measured and/or calculated and displayed over a small period of elapsed time. Furthermore, the resonant frequency (in Hz), or the carrier frequency at which resonance may occur, and the energy (in kWh) may be analyzed and displayed on graph 600 or separate graphs in real time.

The data collected in step 306 may also be stored in the memory of the HMI 216 in step 310. Once a number of data gatherings have occurred, this historical data may be analyzed and displayed for both the input and output side of the VFD 112. Such historical data may be useful for analyzing trends, predicting behavior, and potentially avoiding THD limit violations and VFD-ESP system damage and wear. New data gathered in step 306 may be added to the historical data on this or the next iteration of step 310. If available, the historical data may also include data collected before the well was operated with the real-time monitoring system according to embodiments of the invention.

Referring now to FIG. 7, a graph 700 of historical data for the input side of the VFD 112 may include data collected over a period of several months for such operating data as THDv (in %), THDi 702 (in %), operating frequency 704 (in Hz), total oil loss 706 (in stock tank barrels (stb)), and numbers of transformer, VFD, and switchboard shutdowns 708, 710, 712. In FIG. 8, a graph 800 of historical data for the output side of the VFD 112 may include data collected over a period of several months for such operating data as energy 802 (in kWh), motor run life 804 (in days), THD 806 (in %), operating frequency 808 (in Hz), carrier frequency 810 (in Hz), VFD apparent power 812 (in kVA), motor voltage imbalance 814 (in %), motor current imbalance 816 (in %), motor vibration 818 (in g), and motor temperature (in ° F.).

In step 312, the analyzed data from step 308 and the historical data from step 310 may be further analyzed to decide if fine-tuning of the VFD operating parameters is possible. This decision may be based in part on an economic analysis of the historical data. The goal here may be to find equilibrium, where the maximum possible oil production can be achieved while the cleanest possible voltage and current waveforms (i.e., least distorted waveforms) are supplied to the electrical motor of the ESP 102 and the lowest possible level of harmonics is generated on the input side of the VFD 112 to disturb the input power source 120. In addition, since resonance leads to instability thereby making the job of finding equilibrium of the operating parameters much more difficult, the VFD 112 should be operated with a carrier frequency outside of the resonant area. This approach may allow the operator to gain maximum profit from production optimization procedures by incrementally achieving maximum production while maintaining a high ESP run life and decreasing expenditures (e.g., fines imposed by power companies for distorted power and fees from failed power generators, motors, transformers, and other equipment on the power supply line).

If the VFD operating parameters can be fine-tuned to reach a desired equilibrium, then one or more of these parameters may be adjusted in step 314. The VFD operating parameters (e.g. operating frequency and carrier frequency) may be adjusted automatically. For example, the VFD 112 may be automatically adjusted by sending a signal from the HMI 216 to the RTU 214, which may in turn send a control signal to the VFD 112. In some cases, if the analysis suggests that the output voltage needs to be optimized and it cannot be done by automatic adjustment of the VFD base frequency, a VFD transformer tap setting should be adjusted, and then the VFD 112 may need to be temporarily shut down for manual adjustment of the VFD transformer 116. Once the adjustment has been made, then data collection may resume at step 306 in a continuous loop, thereby allowing the operator to monitor the effects of the adjustments to the VFD-ESP system in real time. In the case of a VFD shutdown, however, the process may need to be restarted at step 302 to reinitialize the VFD operating parameters and then re-commission the well in step 304.

If the VFD operating parameters cannot be fine-tuned according to the decision made in step 312, then data collection may resume at step 306 in a loop. Over time and as fluid is extracted from the well, conditions may change. For instance, the operator may desire to increase the ESP rotational speed 102 as oil is depleted from the well in an effort to maintain a certain fluid flow rate. To increase the pressure, the electric motor may eventually need to be supplied with a higher operating frequency from the VFD 112 in step 314 to increase the motor's rotational speed. However, this increase in operating frequency should be balanced against the risk of increasing the THD according to embodiments of the invention.

Multiple VFD-ESP System Optimization

The techniques described above may be extended to finding equilibrium for multiple wells, each having a VFD-ESP system that may be fine-tuned in an effort to achieve the maximum possible oil production from all of the wells, while the least distorted waveforms are supplied to the electrical motors of the ESPs and the lowest possible level of harmonics is generated on the input side of the VFDs to disturb the input power source. In this case, the input power source may be shared by some, if not all, of the multiple wells being monitored in real time. Multi-well monitoring may also present an advantage over single well monitoring by permitting an operator to consider more variables at once and make more informed tradeoffs.

A single Human Machine Interface (e.g., a personal computer), such as the HMI 216 in FIG. 2, may be used to analyze the data collected from the plurality of wells via one or more RTUs and decide whether the operating parameters can be fine-tuned. The HMI may also send signals to the one or more RTUs to relay control signals to one or more of the VFDs to adjust the operating parameters as described above. Those skilled in the art will appreciate that other configurations of networked HMIs and/or RTUs may be deployed to gather data from and adjust the operating parameters of the multiple VFD-ESP systems in an effort to achieve production equilibrium as described herein.

CONCLUSION

The use of real time monitoring and analysis on the VFD-ESP system may provide for fine-tuning of the system such that fluid production, power, and equipment run life are optimized simultaneously. Such an approach to oil/water production may permit a broader approach to ESP performance optimization, where downhole parameters are measured and analyzed in conjunction with surface parameters.

Advantages of the techniques described herein may involve optimization of the equipment operating parameters including, but not limited to, VFD operating frequency, carrier frequency, VFD transformer tap settings, and base frequency. Other advantages may include avoiding or reducing the number of well shutdowns, lowering production costs from equipment failures and replacements and fines from the power companies, reducing the electric motor and power cable temperatures, and determining desired well-commissioning techniques.

While the foregoing is directed to embodiments of the present invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow. 

1. A method of adjusting one or more operating parameters of a variable frequency drive (VFD) coupled to an electric submersible pump (ESP) in real time, comprising: (a) collecting data associated with the VFD and the ESP while operating the ESP; (b) analyzing the collected data in real time to determine if the one or more operating parameters can be adjusted to achieve a desired operating state; and (c) in response to determining that the operating parameters can be adjusted to achieve the desired operating state, adjusting the one or more operating parameters of the VFD.
 2. The method of claim 1, wherein the operating parameters comprise at least one of an operating frequency, a carrier frequency, a base frequency, a target operating frequency, a VFD transformer tap setting, and an operating frequency ramp profile.
 3. The method of claim 1, wherein collecting data associated with the VFD and the ESP is done without interfering with or impeding operation of the ESP.
 4. The method of claim 1, wherein the collected data comprise at least one of current total harmonic distortion (THD), voltage THD, a VFD operating frequency, a VFD carrier frequency, a VFD base frequency.
 5. The method of claim 1, wherein the collected data comprises at least one of oil loss, a number of transformer shutdowns, a number of VFD shutdowns, a number of switchboard shutdowns, motor torque, motor vibration, motor current imbalance, motor voltage imbalance, motor temperature, and an apparent power of the VFD.
 6. The method of claim 1, further comprising analyzing historical data associated with the VFD and the ESP in conjunction with the collected data to determine if the one or more operating parameters can be adjusted to achieve a desired operating state.
 7. The method of claim 1, wherein the desired operating state comprises an equilibrium between a maximum possible hydrocarbon production, a minimum distortion on waveforms to an electrical motor of the ESP, and a minimum level of harmonics on an input side of the VFD.
 8. The method of claim 1, wherein the desired operating state does not violate a total harmonic distortion (THD) limit on an input side of the VFD.
 9. An apparatus for monitoring and adjusting one or more operating parameters of a variable frequency drive (VFD) coupled to an electric submersible pump (ESP) in real time, comprising: a waveform capture device electrically coupled to the VFD for determining data associated with the VFD and the ESP while operating the ESP, comprising: one or more input voltage or current meters coupled to one or more VFD inputs; and one or more output voltage or current meters coupled to one or more VFD outputs; and a computing device coupled to the waveform capture device and configured to analyze the data determined by the waveform capture device in real time to determine if the one or more operating parameters can be adjusted to achieve a desired operating state and to adjust the one or more operating parameters of the VFD if the operating parameters can be adjusted.
 10. The apparatus of claim 9, further comprising a remote terminal unit coupled between the waveform capture device and the computing device and configured to adjust the operating parameters of the VFD based on an input from the computing device.
 11. The apparatus of claim 9, further comprising a processing unit coupled to the input and output voltage or current meters and configured to sample the meters and provide the data determined by the waveform capture device to the computing device.
 12. The apparatus of claim 9, wherein the desired operating state comprises an equilibrium between a maximum possible hydrocarbon production, a minimum distortion on waveforms to an electrical motor of the ESP, and a minimum level of harmonics on an input side of the VFD.
 13. The apparatus of claim 9, wherein the desired operating state does not violate a total harmonic distortion (THD) limit on an input side of the VFD.
 14. The apparatus of claim 9, wherein the operating parameters comprise at least one of an operating frequency, a carrier frequency, a base frequency, a target operating frequency, a VFD transformer tap setting, and an operating frequency ramp profile.
 15. The apparatus of claim 9, wherein the waveform capture device is configured to determine the data associated with the VFD and the ESP without interfering with or impeding operation of the ESP.
 16. A system, comprising: a variable frequency drive (VFD); an electric submersible pump (ESP) coupled to the VFD; a waveform capture device electrically coupled to the VFD for determining data associated with the VFD and the ESP while operating the ESP, comprising: one or more input voltage or current meters coupled to one or more VFD inputs; and one or more output voltage or current meters coupled to one or more VFD outputs; and a computing device coupled to the waveform capture device and configured to analyze the data determined by the waveform capture device in real time to determine if the one or more operating parameters can be adjusted to achieve a desired operating state and to adjust the one or more operating parameters of the VFD if the operating parameters can be adjusted.
 17. The system of claim 16, further comprising a remote terminal unit coupled between the waveform capture device and the computing device and configured to adjust the operating parameters of the VFD based on an input from the computing device.
 18. The system of claim 16, wherein the operating parameters comprise at least one of an operating frequency, a carrier frequency, a base frequency, a target operating frequency, a VFD transformer tap setting, and an operating frequency ramp profile.
 19. A computer-readable medium containing a program for adjusting one or more operating parameters of a variable frequency drive (VFD) coupled to an electric submersible pump (ESP) in real time, which, when executed by a processor, performs operations comprising: (a) collecting data associated with the VFD and the ESP while operating the ESP; (b) analyzing the collected data in real time to determine if the one or more operating parameters can be adjusted to achieve a desired operating state; and (c) in response to determining that the operating parameters can be adjusted to achieve the desired operating state, adjusting the one or more operating parameters of the VFD.
 20. The computer-readable medium of claim 19, wherein the operating parameters comprise at least one of an operating frequency, a carrier frequency, a base frequency, a target operating frequency, a VFD transformer tap setting, and an operating frequency ramp profile.
 21. The computer-readable medium of claim 19, wherein the desired operating state comprises an equilibrium between a maximum possible hydrocarbon production, a minimum distortion on waveforms to an electrical motor of the ESP, and a minimum level of harmonics on an input side of the VFD. 